package team.stride.database.crud.results;

import java.text.DateFormat;
import java.util.Date;



public class ResultsItem
{
	private int id;
	private String name;
	private String username;
	private long date;
	private float laps;
	private float length;
	private int time;
	private float topSpeed;
	private String details;

	public ResultsItem(int id, String name, String username, long date, float laps, float length, int time,
			float topSpeed, String details)
	{
		this.id = id;
		this.name = name;
		this.username = username;
		this.date = date;
		this.laps = laps;
		this.length = length;
		this.time = time;
		this.topSpeed = topSpeed;
		this.details = details;
	}

	public int getId()
	{
		return id;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getUsername()
	{
		return username;
	}

	public void setUsername(String username)
	{
		this.username = username;
	}

	public long getDate()
	{
		return date;
	}

	public String getStringDate()
	{
		Date d = new Date(date);
		 return DateFormat.getDateTimeInstance(
		            DateFormat.MEDIUM, DateFormat.SHORT).format(d);
	}

	public void setDate(int date)
	{
		this.date = date;
	}

	public float getLaps()
	{
		return laps;
	}

	public void setLaps(float laps)
	{
		this.laps = laps;
	}

	public float getLength()
	{
		return length;
	}

	public void setLength(float length)
	{
		this.length = length;
	}

	public int getTime()
	{
		return time;
	}

	public void setTime(int time)
	{
		this.time = time;
	}

	public float getTopSpeed()
	{
		return topSpeed;
	}

	public void setTopSpeed(float topSpeed)
	{
		this.topSpeed = topSpeed;
	}

	public String getDetails()
	{
		return details;
	}

	public void setDetails(String details)
	{
		this.details = details;
	}

	public String toHTMLString()
	{
		return "Date: " + date + "<br/>" + "Details: " + details + "<br/>" + "Id:" + id + "<br/>" + "Laps: " + laps
				+ "Length: " + length + "<br/>" + "Name: " + name + "<br/>" + "Time: " + time + "<br/>" + "TopSpeed: "
				+ topSpeed + "<br/>" + "Username: " + username;
	}
}
